﻿<?xml version="1.0"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Blazing.BusinessObjects" namespace="Blazing.BusinessObjects.Tagging" >
	<class name="TaxonomyTag" table="taxonomytags" lazy="true" dynamic-insert="true" dynamic-update="true">    
    
    <id name="ID" column="taxonomytagid" type="Int32">
			<generator class="native" />
		</id>
		<timestamp name="RowStamp" column="rowstamp" />    
    
    <property name="Description" column="description"  length="255" />
    <property name="Count" column="count" type="Int32" />
	<property name="IsSelectable" column="selectable" type="Boolean" />		
	<property name="IsVisible" column="visible" type="Boolean" />
    <many-to-one name="Taxonomy" column="taxonomyid" class="Taxonomy" />
    <many-to-one name="ParentTaxonomyTag" column="parenttaxonomytagid" class="TaxonomyTag" cascade="delete" />
    <many-to-one name="Tag" column="tagid" class="Tag" />
    <property name="Slug" length="255" unique="true" />
    <property name="ChildrenMutuallyExclusive" type="Boolean" column="childrenmutuallyexclusive" />

    <set name="ChildTaxonomyTags" inverse="true" table="taxonomytags">
      <key column="parenttaxonomytagid" />
      <one-to-many class="TaxonomyTag" />
    </set>
    
	</class>
</hibernate-mapping>
